import paddlehub
import cv2

test_image = "./test.png"

# ocr = paddlehub.Module(name="chinese_ocr_db_crnn_mobile")
ocr = paddlehub.Module(name="chinese_ocr_db_crnn_server")

images_result = ocr.recognize_text(images=[cv2.imread(test_image)])


for image in images_result:
    print(image)
    # if image.get('data'):
    #     for d in image.get('data'):
    #         print('-------------------------')

    #         print(d)